package com.easylinkin.linkappapi.lobar.controller;

import com.easylinkin.linkappapi.common.utils.async.AsyncUtil;
import com.easylinkin.linkappapi.common.utils.excel.RedisAsyResultData;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: kan yuanfeng
 * @Date: 2021/1/19 14:11
 * @Description: 统一的异步接口
 */
@RestController
@RequestMapping("sync")
public class SyncRedisController {

  /**
   * 根据key获取导出接口
   * @param key
   * @return
   */
  @GetMapping("getRedisResult/{key}")
  public RedisAsyResultData getRedisResult(@PathVariable String key){
    Assert.hasLength(key,"key不能为空");
    return AsyncUtil.getResult(key);
  }
}
